home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
Source
/
DBL Pascal Library
/
ErrSignal
/
TestSignals_4.p
< prev
next >
Wrap
Text File
|
1992-03-24
|
737b
|
50 lines
program main;
uses
ErrSignal;
var
mainCatch: Integer;
procedure TestProc;
var
catch: Integer;
procedure SubProc;
var
dummy: Integer;
begin
writeln('entering SubProc');
Signal(1);
end;
procedure Handler;
var
dummy: Integer;
begin
writeln('entering Handler');
SignalHandlerDone;
Exit(TestProc);
end;
begin
writeln('entering TestProc');
catch := CatchSignal;
if catch <> 0 then
Handler;
writeln('catch established in TestProc');
SubProc;
end;
procedure Caller1;
begin
TestProc;
end;
begin { main }
ShowText;
InitSignals(sigFail);
mainCatch := CatchSignal; {Without this - we never return from test Proc - Why?}
Caller1;
writeln('returned to main');
end.